package android.Spider;

import java.util.ArrayList;

import android.content.Intent;
import android.view.View;
import android.widget.ListView;

public class ManageInquiries extends PictureConnectionListActivity
{
	@Override
	void InitConnection() {
        m_connection = null;
	}

	@Override
	void InitListAdapter() {
		super.InitListAdapter();
		
		ArrayList<ListItem> lstItems = new ArrayList<ListItem>(5);
		for (int i = 0; i < 3; ++i)
		{
			ListItem item = new ListItem();
			item.m_strDesc = arrTitle[i];
			item.m_strFineDesc = arrDesc[i];
			item.m_bmpPicture = getResources().getDrawable(arrPictures[i]);
			lstItems.add(item);
		}
		
		SetListItems(lstItems);
	}
	
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id)
	{
		super.onListItemClick(l, v, position, id);
		
		Intent intent = new Intent(this, arrClasses[position]);
		startSubActivity(intent, 0);
	}

	private final String arrTitle[] = {
			"New Query",
			"New Poll",
			"My inquiry results"
	};
	
	private final String arrDesc[] = {
			"Create a new query",
			"Create a new poll",
			"View results of my inquiries"
	};
	
	private final int arrPictures[] = {
		R.drawable.newquery,
		R.drawable.newpoll,
		R.drawable.inquiryresult
	};
	
	@SuppressWarnings("unchecked")
	private final Class arrClasses[] = {
			QuerySend.class,
			PollSend.class,
			InquiriesResults.class
	};
}
